home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
news
/
moderating
/
posting.Z
/
posting
Wrap
Internet Message Format
|
1994-05-06
|
4KB
From owner-moderators@uunet.uu.net Wed Apr 20 16:36:36 1994
Received: from uunet.UUCP by sparky.sterling.com
id AA22710; Wed, 20 Apr 1994 16:36:35 -0500
Return-Path: <owner-moderators@uunet.uu.net>
Received: by rodan.UU.NET (5.61/UUNET-mail-drop)
id AA27786; Wed, 20 Apr 94 17:19:24 -0400
Received: from relay1.UU.NET by rodan.UU.NET with SMTP
(5.61/UUNET-mail-drop) id AA27781; Wed, 20 Apr 94 17:19:20 -0400
Received: from introl.introl.com by relay1.UU.NET with SMTP
(5.61/UUNET-internet-primary) id AAwmmn15122; Wed, 20 Apr 94 17:19:12 -0400
Received: (from tjk@localhost) by introl.introl.com (8.6.8/8.6.6) id QAA24305; Wed, 20 Apr 1994 16:18:14 -0500
Message-Id: <199404202118.QAA24305@introl.introl.com>
From: tjk@introl.introl.com (Thomas Krueger)
Date: Wed, 20 Apr 1994 16:18:14 -0500
In-Reply-To: Joel Furr <jfurr@acpub.duke.edu>
"Posting script" (Apr 20, 4:59pm)
X-Mailer: Mail User's Shell (7.2.5 10/14/92)
To: Joel Furr <jfurr@acpub.duke.edu>
Subject: Re: Posting script
Cc: moderators@uunet.uu.net
Status: OR
I use mush to pipe each message to this script:
dir='/u/tjk/newsgroup'
digest='/u/tjk/digest'
mv /u/tjk/.signature /u/tjk/.si
awk -f $dir/script.awk > $dir/body.$$
grep -i "from:" $dir/body.$$ >> $dir/logfile
grep -i "subject:" $dir/body.$$ >> $dir/logfile
cat $dir/Headers $dir/body.$$ > $dir/article.$$
/usr/ucb/head $dir/article.$$ < /dev/tty
echo " "
/bin/echo -n "Are you sure you want to post this? "
read answer < /dev/tty
echo " "
if [ "$answer" = "no" -o "$answer" = "n" ]
then
echo posting cancelled.
/bin/rm -f $dir/article.$$ $dir/body.$$
mv /u/tjk/.si /u/tjk/.signature
exit 0
fi
cat $dir/article.$$ | /usr/local/news/inews -h >> $dir/logfile
echo -n "From zoo " >> $digest/outbound
echo `date` >> $digest/outbound
cat $dir/article.$$ >> $digest/outbound
echo "" >> $digest/outbound
rm -f $dir/body.$$ $dir/article.$$
mv /u/tjk/.si /u/tjk/.signature
---
This is the awk script:
#
# Awk Script called by 'digest'. See DIGEST(1)
#
# Version two - sucks in the '>From' lines too...
# (guarantees a "valid" return address!)
BEGIN {
message = 0;
last = "this should never be matched"
in_header = 1;
have_from = 0;
}
$1 ~ /^From$/ {
message++;
in_header = 1;
from = $2;
parse_count = 0;
have_from = 0;
last = "we should have a hard time matching this, too"
}
$1 ~ /^From:/ { if (in_header) print $0;
have_from = 1 }
$1 ~ /^>From/ { parse_count++;
address = $2
if (parse_count > 1)
from = from"!"$10
else
from = $10
}
$1 ~ /^Subject:/ { if (in_header) print $0 }
$1 ~ /^Reply-To:/ { if (in_header) print $0 }
$1 ~ /^References:/ { if (in_header) print $0 }
$1 ~ /^Organization:/ { if (in_header) print $0 }
$1 ~ /^Date:/ { if (in_header) print $0 }
length($0) < 2 {
if (in_header == 1)
if (have_from == 0)
print "From: "from"!"address
if ($0 != last)
print $0
in_header = 0
last = $0
}
in_header == 0 { if ($0 != last)
print $0
last = $0
}
---
The extra stuff in there to put things into an additional "mailbox" is so
I can then send out the saved stuff as a digest later.
- Tom
Thomas Krueger Introl Corporation Moderator:
Technical Writer 9220 West Howard Avenue rec.audio.high-end
+1 (414) 327-7171 Milwaukee WI 53228-1644 and Mystery list